package hl.crazy_java.chapter_6;


/**
 * 
 * @author Liu Huan
 */

abstract class Shape {
    private String color;
    public abstract double calPermeter();
    public abstract String getType();

    public Shape() {}
    public Shape(String color) {
        this.color = color;
    }

    public String getColor() {
        return color;
    }
}

class Circle extends Shape {

    private double radius;

    @Override
    public double calPermeter() {
        return 2 * radius;
    }

    @Override
    public String getType() {
        return "这是一个圆形";
    }

    public Circle() {};
    public Circle(String color, double radius) {
        super(color);
        this.radius = radius;
    }
}

public class ShapeTest {
    public static void main(String[] args) {
        var s1 = new Circle("red", 4);
        System.out.println(s1.calPermeter());
        System.out.println(s1.getType());
    }
}
